import os
import sys
import shutil
def getSpecifiedTypeFileFromDirectory(file_dir):
    """
    获取路径文件名
    :return:
    """
    L = []
    for dirpath, dirnames, filenames in os.walk(file_dir):
        for file in filenames:
            if file[0] == ".":
                continue
            L.append(file)
    return L

def getFileNameNotSufFromPath(path):
    """
    从路径中获取文件名，不包含后缀
    :param path:
    :return:
    """
    basename = os.path.basename(path)
    return os.path.splitext(basename)[0]

def main(argv):
    originPath = argv[0]  # 原始路径
    targetPath = argv[1]  # 目标路径
    print("打开路径", originPath)
    print("存储路径", targetPath)
    originPathList = getSpecifiedTypeFileFromDirectory(originPath)
    targetPathList = getSpecifiedTypeFileFromDirectory(targetPath)
    res = set(originPathList) - set(targetPathList)
    for item in res:
        path = originPath + "/"+ item
        shutil.copy(path,targetPath)
    print("检查结果"+str(res))
    


if __name__ == "__main__":
    main(sys.argv[1:])
